import recursiveReaddirFiles from 'recursive-readdir-files'
import path from 'node:path'

const files = await recursiveReaddirFiles(process.cwd(), {
    ignored: /[\\/](node_modules|\.git)/g,
    exclude: /(\.json|\.mjs|CONTRIBUTING\.md)$/,
    filter: (item) => item.ext === 'md',
})

console.log(files)

const path2 = path.relative('refs', files[1].path)
console.log(path2)

console.log(
    path.resolve('dist', 'refs', 'nest.js')
)

const newp = path.resolve('D:/_FrontEndPrograms/_quickref-cli/docs', 'refs', 'nest.md')
        .replace(/README.md$/i, 'index.html')
        .replace(/.md$/, '.html')
console.log(newp)